
@import "../../../assets/styles/element-variables.scss";

@mixin sub-card {
  border: 1px solid #EFEFEF;
  .v-card__header {
    background-color: #EDEFF5;
    padding-top: 6px;
    padding-bottom: 6px;
    &-title {
      font-size: 14px;
    }
  }

  .v-card__body {
    padding: 12px;
    padding-top: 12px;
  }
}

.v-card {
  width: 100%;
  position: relative;
  box-sizing: border-box;
  border-radius: 4px;
  background-color: #fff;
  font-size: 14px;
  color: #333;
  &__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    line-height: 28px;
    box-sizing: border-box;
    &-title {
      flex: 1;
      margin: 0;
      margin-right: 16px;
      display: flex;
      padding: 0;
      font-weight: 600;
      font-size: 16px;
      align-items: center;
      &.collapse {
        cursor: pointer;
        .v-card__header-icon {
          color: $--color-primary;
          text-align: center;
          &:hover {
            background-color: rgba(0, 0, 0, 6%);
            cursor: pointer;
            border-radius: 2px;
          }
        }
      }

      .v-card__header-icon {
        color: $--color-primary;
        display: inline-block;
        width: 20px;
        height: 20px;
        line-height: 20px;
        font-size: 22px;
        margin-right: 2px;
      }
    }

    &-collapse {
      cursor: pointer;
      user-select: none;
    }
  }

  &__body {
    padding: 0 16px 16px;
    .v-card {
      @include sub-card();
    }
  }

  &--border {
    border: 1px solid #EFEFEF;
    box-shadow: none;
  }

  &--header-border {
    .v-card__header {
      border-bottom: 1px solid #EFEFEF;
    }
  }

  &--body-padding-top {
    .v-card__body {
      padding-top: 16px;
    }
  }

  &--sub-card {
    @include sub-card();
  }
}
